home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
026-050
/
scopedisk46
/
mj-pgs
/
m-graph_t
< prev
next >
Wrap
Text File
|
1995-03-18
|
3KB
|
69 lines
PRINT " Mandelgraph.V4":PRINT
REM A.Wachtel, September 1988
PRINT "This program reads an file of iteration count statistics and draws bargraphs"
PRINT "of the number of times each iteration count occurred. Inspection of these"
PRINT " (e.g. of discontinuities) may be helpful in selecting ""breakpoints""(counts"
PRINT "where the color should change in a plot program.":PRINT
PRINT "The graph is divided in 2 portions: 0-200 (top), and 200-2000 (bottom)."
PRINT "Note that in both cases, the bar lengths are normalized to the local maximum."
PRINT :INPUT"enter the name of the inform file ";f1$
INPUT "enter the name of the statistics file ";f2$
DEFINT i,y:DEFLNG m,n
OPEN f1$ FOR INPUT AS 1
INPUT#1,region$
INPUT#1,horpix,verpix,sym$,typeflag$
INPUT#1,lowcount,iterlimit,isizelimit
CLOSE #1
PRINT :IF typeflag$="j" THEN PRINT "Julia Set" ELSE PRINT "Mandelbrot"
IF sym$="y" THEN PRINT "symmetric" ELSE PRINT "not symmetric"
PRINT "0 -"horpix-1" hor. pixels, 0 -"verpix-1" vert. pixels"
PRINT "sugg. lowest count="lowcount" ,iter.limit="iterlimit" ,'jsizelimit="isizelimit
PRINT "additional information is obtained by typing this file from DOS."
itop=iterlimit+isizelimit:IF itop>2000 THEN itop=2000
IF itop<200 THEN lim=itop ELSE lim=200
DIM n(itop),y(itop)
OPEN f2$ FOR INPUT AS 2
FOR i=1 TO itop:INPUT#2,n(i):NEXT
CLOSE#2
FOR i=1 TO lim
IF n(i)>max1 THEN max1=n(i)
NEXT :IF max1>0 THEN corr1=75/max1:REM max. bar length = 75 pixels
IF itop=<200 THEN GOTO coordinates
FOR i=200 TO itop-1
IF n(i)>max2 THEN max2=n(i)
NEXT i:IF max2>0 THEN corr2=75/max2
coordinates:
CLS
LINE (0,0)-(0,80):LINE (0,75)-(631,75):REM coordinates
x1=617/(LOG(200)-LOG(10)):x2=LOG(10)*x1:x1loc=x1/8:x2loc=x2/8
FOR i=10 TO 200 STEP 10:LINE (LOG(i)*x1-x2,75)-(LOG(i)*x1-x2,80):NEXT i:REM tic marks
LOCATE 11,1:PRINT "10":LOCATE 11,LOG(30)*x1loc-x2loc:PRINT "30";
FOR i=50 TO 200 STEP 50:LOCATE 11,LOG(i)*x1loc-x2loc-2:PRINT i:NEXT:REM label
IF itop=<200 THEN GOTO plot
LINE (0,95)-(0,177):LINE (0,172)-(631,172)
x3=617/(LOG(2000)-LOG(200)):x4=LOG(200)*x3:x3loc=x3/8:x4loc=x4/8
FOR i=200 TO 2000 STEP 100:LINE (LOG(i)*x3-x4,172)-(LOG(i)*x3-x4,177):NEXT i
LOCATE 23,1:PRINT "200";:FOR i=400 TO 1000 STEP 200: LOCATE 23,LOG(i)*x3loc-x4loc-2:PRINT i;:NEXT
LOCATE 23,LOG(1500)*x3loc-x4loc-1:PRINT "1500";:LOCATE 23,LOG(2000)*x3loc-x4loc-1:PRINT "2000";
plot:
FOR i=10 TO lim:y(i)=75-n(i)*corr1
LINE (LOG(i)*x1-x2,75)-(LOG(i)*x1-x2,y(i)):NEXT
LOCATE 2,60:PRINT "maximum="max1
IF itop=<200 THEN END
FOR i=200 TO itop-1:y(i)=172-n(i)*corr2
LINE (LOG(i)*x3-x4,172)-(LOG(i)*x3-x4,y(i)):NEXT
LOCATE 14,40:PRINT "maximum="max2;" limit counts ="n(itop)
END